package com.gxkj.movie.utils.logback;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.MappingJsonFactory;
import net.logstash.logback.decorate.JsonFactoryDecorator;

/**
 * 实现自己的JsonFactoryDecorator，在该类中禁用jackson对非ascii码进行escape编码的特性
 */
public class MyJsonFactoryDecorator implements JsonFactoryDecorator {



    @Override
    public MappingJsonFactory decorate(MappingJsonFactory factory) {

        // 禁用对非ascii码进行escape编码的特性

        factory.disable(JsonGenerator.Feature.ESCAPE_NON_ASCII);

        return factory;

    }

}